package expansion.spi;

import expansion.initialize.MyApplicationContextInitializer;
import org.springframework.core.io.support.SpringFactoriesLoader;

import java.util.List;
import java.util.ServiceLoader;

public class SpringFactories {
    /**
     * Service Provider Interface
     *
     * @see SpringFactoriesLoader
     * @see ServiceLoader
     */
    public static void main(String[] args) {
        List<MyApplicationContextInitializer> beans = SpringFactoriesLoader.loadFactories(
                MyApplicationContextInitializer.class, SpringFactories.class.getClassLoader());
        beans.stream().forEach(System.out::println);
    }
}
